package com.ruiysoft.website.controller;

import com.ruiysoft.website.dto.ResponseEx;
import com.ruiysoft.website.service.CmsCatalogService;
import com.ruiysoft.website.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by liudh on 2019/4/25.
 */

@RestController
@RequestMapping("catalog")
public class CmsCatalogController {
    @Autowired
    CmsCatalogService cmsCatalogService;

    @GetMapping("query")
    public Object query(Integer enterpriseId, String parentCode) {
        ResponseEx responseEx = new ResponseEx();
        responseEx.setSuccess(false);

        Object obj = cmsCatalogService.selectList(enterpriseId, parentCode);
        if(obj != null) {
            responseEx.setSuccess(true);
            responseEx.setData(obj);
        }

        return responseEx;
    }

}

